package source.model.technology;

import source.view.MainScreen;
import source.model.*;

public class UpgradeUnitDefensiveDamage extends UnitTechnology {

	private int amount;
	
	public UpgradeUnitDefensiveDamage(){
		this(1);
	}
	
	public UpgradeUnitDefensiveDamage(int amount){
		this(amount, (int)(Math.random()*100));
	}
	
	public UpgradeUnitDefensiveDamage(int amount, int research){
		this.amount=amount;
		setResearchTillDone(research);
	}
	
	public void teach(Player p) {
		p.modDDBonus(amount);
		MainScreen.writeToConsole("You have aquired a + " + amount + " to Armor!");
	}

	public void research(int amount){
		decrementResearchTillDone(amount);
	}
	
	public String toString(){
		return "Unit Defensive Damage Upgrade";
	}
}
